<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/views1/DTD/views1-transitional.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">
	<div class="grid_18">
		<p:messages id="mensages" showSummary="false" showDetail="true" />
	</div>

	<div class="grid_4 div-label">Ano/Semestre</div>
	<div class="grid_14 div-campo">
		<h:selectOneMenu value="#{ofertaDisciplinaBean.ofertaInstance.ano}"
			styleClass="ui-inputfield ui-widget ui-state-default ui-corner-all width_3"
			converter="javax.faces.DateTime">
			<f:selectItems value="#{ofertaDisciplinaBean.anosList}" />
		</h:selectOneMenu>
		<p:spacer width="2" height="1" />
		/
		<p:spacer width="2" height="1" />
		<h:selectOneMenu
			value="#{ofertaDisciplinaBean.ofertaInstance.semestre}"
			styleClass="ui-inputfield ui-widget ui-state-default ui-corner-all width_2">
			<f:selectItem itemLabel="01" itemValue="1" />
			<f:selectItem itemLabel="02" itemValue="2" />
		</h:selectOneMenu>
	</div>

	<div class="grid_4 div-label">Disciplina:</div>
	<div class="grid_10 div-campo">
		<p:inputText id="oferta_disciplina_disciplina" disabled="true"
			widgetVar="oferta_disciplina_disciplina" styleClass="width_9"
			value="#{ofertaDisciplinaBean.ofertaInstance.disciplina.nome}" />
	</div>
	<div class="grid_4" style="margin-top: -3px;">
		<p:commandButton image="ui-icon ui-icon-search" type="button"
			value="Buscar" onclick="promptBuscaDisciplina.show();" />
	</div>

	<div class="clear"></div>

	<div class="grid_4 div-label">Professor:</div>
	<div class="grid_10 div-campo">
		<p:inputText id="oferta_disciplina_professor" disabled="true"
			widgetVar="oferta_disciplina_professor" styleClass="width_9"
			value="#{ofertaDisciplinaBean.ofertaInstance.professor.nomeCompleto}" />
	</div>
	<div class="grid_4" style="margin-top: -3px;">
		<p:commandButton image="ui-icon ui-icon-search" type="button"
			value="Buscar" onclick="promptBuscaProfessor.show();" />
	</div>

	<div class="grid_11 subtitulo">Alunos</div>
	<div style="text-align: right; margin-top: 10px; padding-left: 35px;"
		class="grid_6 div_32">
		<p:commandButton id="btn_Adicionar" type="button" value="Adicionar"
			onclick="promptAdicionaAluno.show();" />
		<p:commandButton id="btn_Remover"
			disabled="#{ofertaDisciplinaBean.alunoOfertaInstance eq null}"
			action="#{ofertaDisciplinaBean.removerAluno}" value="Remover"
			update="formPrincipal, formPromptBuscaAluno" />
	</div>
	<div class="clear"></div>
	<div class="grid_18">
		<p:dataTable id="dataTableAlunos" paginator="true"
			selection="#{ofertaDisciplinaBean.alunoOfertaInstance}"
			value="#{ofertaDisciplinaBean.alunoOfertaList}"
			selectionMode="single" var="a" update="formPrincipal:btn_Remover"
			emptyMessage="Nenhum registro encontrado!" rows="10" dynamic="true">
			<p:column headerText="Matricula" sortBy="#{a.aluno.matricula}">
				<h:outputText value="#{a.aluno.matricula}" />
			</p:column>
			<p:column headerText="Nome" sortBy="#{a.aluno.nomeCompleto}">
				<h:outputText value="#{a.aluno.nomeCompleto}" />
			</p:column>
		</p:dataTable>
	</div>
</f:view>